package org.example.server.goods.mapstruct.goods;

import org.example.api.goods.goods.enums.SalesTypeEnum;
import org.example.api.goods.goods.request.AddGoodsRequest;
import org.example.api.goods.goods.response.GoodsFatDetailResponse;
import org.example.api.goods.goods.response.GoodsListItemResponse;
import org.example.server.goods.entity.GoodsEntity;
import org.example.server.goods.repo.doo.GoodsFatDetailDo;
import org.example.server.goods.repo.doo.GoodsListItemDo;
import org.example.server.goods.service.goods.bo.GoodsFatDetailBo;
import org.example.server.goods.service.goods.bo.GoodsListItemBo;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(componentModel = "spring")
public interface GoodsConverter {
  /**
   * 转换实例
   */
  GoodsConverter INSTANCE = Mappers.getMapper(GoodsConverter.class);

  GoodsEntity toGoodsEntity(AddGoodsRequest.BaseInfoRequest baseInfo, SalesTypeEnum salesType);

  GoodsFatDetailBo toGoodsFatDetailBo(GoodsFatDetailDo goodsFatDetailDo);

  GoodsFatDetailResponse toGoodsFatDetailResponse(GoodsFatDetailBo goodsFatDetailBo);

  GoodsListItemDo toGoodsListItemDo(GoodsEntity goodsEntity);

  List<GoodsListItemBo> toGoodsListItemBo(List<GoodsListItemDo> goodsListItemDos);

  GoodsListItemBo toGoodsListItemBo(GoodsListItemDo goodsListItemDo);

  List<GoodsListItemResponse> toGoodsListItemResponse(List<GoodsListItemBo> goods);
}
